var express = require('express');
var router = express.Router();

/* GET home page. */
router.get('/', function(req, res, next) {
  res.render('index', { title: 'Home Work API' });
});
router.post('/api/demo1', function(req, res, next) {
  let response = {
    data:{
      data:{
        code:0,
        message:'请求成功',
        list:[
          {id:0,name:'小谢'},
          {id:1,name:'小hong'},
          {id:2,name:'xiaogou'}
        ]
      }
    }          
  }
  res.json(response)
});
module.exports = router;
